package org.luckyjourney.entity.agent;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 2智能体表
 * @TableName agent_table
 */
@Data
public class AgentTable implements Serializable {
    /**
     * 智能体ID
     */
    @TableId(value = "agent_id", type = IdType.AUTO)
    private Integer agentId;

    /**
     * 智能体名称
     */
    private String agentName;

    /**
     * 智能体提示词
     */
    private String agentHint;

    /**
     * 智能体头像
     */
    private String agentProfile;

    /**
     * 智能体分类
     */

    private Integer agentCategoryId;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @TableField(value = "usage_model_id")
    private  Integer usageModelId;

    @TableField(value = "usage_tone_id")
    private Integer usageToneId;

    @TableField(exist = false)
    private String toneName;

    @TableField(value = "is_recommend")
    private Integer isRecommend;

    //临时字段是否添加智能体到对话
    @TableField(exist = false)
    private Boolean inChat;

    //用户添加到智能体的数量  false是为未添加到对话列表(或加号+)   true是已添加到对话列表(或对勾)
    @TableField(exist = false)
    private int chatsCount;

    @TableField(exist = false)
    private Integer agentChatId;

    //开场白
    @TableField(value = "agent_prologue")
    private String agentPrologue;


    //咨询师id
    @TableField(value = "user_id")
    private Long UserId;

    //咨询师昵称
    @TableField(value = "nick_name")
    private String nickName;


    /*@TableField(exist = false)
    @ApiModelProperty("智能体开场白+对话(列表)")
    private String agentPrologueAndChat;*/

    private static final long serialVersionUID = 1L;

    /**
     * 智能体ID
     */
    public Integer getAgentId() {
        return agentId;
    }

    /**
     * 智能体ID
     */
    public void setAgentId(Integer agentId) {
        this.agentId = agentId;
    }

    /**
     * 智能体名称
     */
    public String getAgentName() {
        return agentName;
    }

    /**
     * 智能体名称
     */
    public void setAgentName(String agentName) {
        this.agentName = agentName;
    }

    /**
     * 智能体提示词
     */
    public String getAgentHint() {
        return agentHint;
    }

    /**
     * 智能体提示词
     */
    public void setAgentHint(String agentHint) {
        this.agentHint = agentHint;
    }

    /**
     * 智能体头像
     */
    public String getAgentProfile() {
        return agentProfile;
    }

    /**
     * 智能体头像
     */
    public void setAgentProfile(String agentProfile) {
        this.agentProfile = agentProfile;
    }

    /**
     * 智能体分类
     */
    public Integer getAgentCategoryId() {
        return agentCategoryId;
    }

    /**
     * 智能体分类
     */
    public void setAgentCategoryId(Integer agentCategoryId) {
        this.agentCategoryId = agentCategoryId;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AgentTable other = (AgentTable) that;
        return (this.getAgentId() == null ? other.getAgentId() == null : this.getAgentId().equals(other.getAgentId()))
            && (this.getAgentName() == null ? other.getAgentName() == null : this.getAgentName().equals(other.getAgentName()))
            && (this.getAgentHint() == null ? other.getAgentHint() == null : this.getAgentHint().equals(other.getAgentHint()))
            && (this.getAgentProfile() == null ? other.getAgentProfile() == null : this.getAgentProfile().equals(other.getAgentProfile()))
            && (this.getAgentCategoryId() == null ? other.getAgentCategoryId() == null : this.getAgentCategoryId().equals(other.getAgentCategoryId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getAgentId() == null) ? 0 : getAgentId().hashCode());
        result = prime * result + ((getAgentName() == null) ? 0 : getAgentName().hashCode());
        result = prime * result + ((getAgentHint() == null) ? 0 : getAgentHint().hashCode());
        result = prime * result + ((getAgentProfile() == null) ? 0 : getAgentProfile().hashCode());
        result = prime * result + ((getAgentCategoryId() == null) ? 0 : getAgentCategoryId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", agentId=").append(agentId);
        sb.append(", agentName=").append(agentName);
        sb.append(", agentHint=").append(agentHint);
        sb.append(", agentProfile=").append(agentProfile);
        sb.append(", agentCategoryId=").append(agentCategoryId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}